Generating Tests by Example

نویسندگان

  • Hila Peleg
  • Dan Rasin
  • Eran Yahav
چکیده

Property-based testing is a technique combining parametric tests with value generators, to create an efficient and maintainable way to test general specifications. To test the program, property-based testing randomly generates a large number of inputs defined by the generator to check whether the test-assertions hold. We present a novel framework that synthesizes property-based tests from existing unit tests. Projects often have a suite of unit tests that have been collected over time, some of them checking specific and subtle cases. Our approach leverages existing unit tests to learn property-based tests that can be used to increase value coverage by orders of magnitude. Further, we show that our approach: (i) preserves the subtleties of the original test suite; and (ii) produces properties that cover a greater range of inputs than those in the example set. The main idea is to use abstractions to over-approximate the concrete values of tests with similar structure. These abstractions are then used to produce appropriate value generators that can drive the synthesized property-based test. We present JARVIS, a tool that synthesizes property-based tests from unit tests, while preserving the subtleties of the original unit tests. We evaluate JARVIS on tests from Apache projects, and show that it preserves these interesting tests while increasing value coverage by orders of magnitude.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

NUMERICAL AND EXPERIMENTAL INVESTIGATION OF WIND PRESSURE COEFFICIENTS ON SCALLOP DOME

The wind loads considerably influence lightweight spatial structures. An example of spatial structures is scallop domes that contain various configurations and forms and the wind impact on a scallop dome is more complex due to its additional curvature. In our work, the wind pressure coefficient (Cp ) on the scallop dome surface is studied numerically and experimentally. Firstly, the programming...

متن کامل

A New Skew-normal Density

We present a new skew-normal distribution, denoted by NSN($lambada$). We first derive the density and moment generating function of NSN($lambada$). The properties of SN($lambada$), the known skew-normal distribution of Azzalini, and NSN($lambada$) are compared with each other. Finally, a numerical example for testing about the parameter $lambada$ in NSN($lambada$) is given. ...

متن کامل

Perturbative Approach to Calculating the Correlation Function of bi-isotropic Metamaterials

A bi-isotropic magneto-electric metamaterials is modeled by two independent reservoirs. The reservoirs contain a continuum of three dimensional harmonic oscillators, which describe polarizability and magnetizability of the medium. The paper aimed to investigate the effect of electromagnetic field on bi-isotropic. Starting with a total Lagrangian and using Euler-Lagrange equation, researcher cou...

متن کامل

A Test Automation Language for Behavioral Models

Model-based testers design tests in terms of models, such as paths in graphs. Abstract tests cannot be run directly because they use names and events that exist in the model, but not the implementation. Testers usually solve this mapping problem by hand. Model elements often appear in many abstract tests, so testers write the same redundant code many times. This is time-consuming, labor-intensi...

متن کامل

The Effects of Student-Generated MCQs on their Academic Achievement

Introduction: Involvement of students in exam questions generating is a technique that has been recently used in order to increase learning and improve academic achievement. This study aimed to investigate the effects of multiple choice questions (MCQ) generating by students on their academic achievement in Ahvaz Jundishapur University of Medical Sciences in 2014-15 academic years. Methods: Thi...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2018